All Questions
Tagged with design-patternsarchitectural-patterns
107 questions
4votes
1answer
166views
Holding state in a service class in MVVM
In my SwiftUI app, I have a UpNextManager view model and a service class called UpNextService which contains many methods to read up next items from disk, write them to disk and much more. The service ...
0votes
2answers
275views
What is a good architecture / design pattern for giving multiple shared attributes in different combinations?
I have a need for many different objects to have various combinations of attributes. For a demonstrative example, a flaming dog would have a dog attribute, a flame attribute, and a tail attribute, ...
1vote
2answers
323views
Combining Command and Visitor design patterns
Designing the architecture of a personal project, I've come up with the idea of using the combination of these two patterns to solve an architectural issue. In an MVC context, I need to implement ...
0votes
0answers
65views
isolating user run scripts on docker without performance impact
Scenario: We have a application (web based), in a small part of this application a users is able to create a small python script to mutate (in memory) data. Currently all of these scripts (if it is ...
0votes
4answers
415views
Best practice for using read-write lock
Given a system where users can access different services through the API for conducting business transactions, I am currently working on integrating a read-write lock into the system. One approach I ...
0votes
0answers
98views
By creating an architecture, it is better to have many classes that handles different scenarios, or a single one that handles all? [duplicate]
During my limited professional experience, I have been involved in microservices projects with a common structure: The Controller takes a request and validates it using the jakarta.validation....
2votes
2answers
259views
How to design fault-tolerant distributed "all-or-nothing" system?
I have a system where Client(C) sends request to Server(S0). S0 then sends the response back to Client that "request received" and closes the connection. C can regularly poll S0 to check on ...
0votes
3answers
438views
How to reconcile the fact that dependency Injection break encapsulation? (Especially when others are allowed to wire up your dependencies for you)
I was reading Martin Fowlers take on Dependency Injection, and in general have been trying to discuss it a bit online to help get rid of my own misconceptions and to understand this principle better. ...
3votes
4answers
299views
Please explain the "swapable dependency" arguments for IOC containers
I get that IOC containers can be useful to help break dependencies and allow you to test a class in isolation. I don't wish to focus on that right now, instead, I'm trying to understand some of the ...
3votes
9answers
4kviews
Is it an anti-pattern to use interface for entity?
I read an article about that using an interface for an entity is an anti-pattern for these reasons: Your interface signature is identical to your class. There’s only one implementation of your ...
1vote
1answer
237views
Implementing MVC in C++ with minimal boilerplate despite lack of reflection
Powerful reflection capabilities make implementing nice architectural design patterns such as MVC and Dependency Injection very simple in languages like Java and Kotlin. In particular, reflective tags ...
0votes
1answer
125views
What is the name of the approach (practice) when several unrelated entities are returned at once in the response to a request [closed]
For example, for a mobile frontend, you need to get all the data for rendering at once. The interface is divided into blocks, in which there can be both blocks with a catalog (categories) and other ...
1vote
1answer
100views
In the state pattern, what happens when the action doesn't depend only on the state?
I have some doubts about the state pattern, but I think it is better to ask one question at a time, so it is easier to focus on the answer. The state pattern establishes which actions can be performed ...
0votes
3answers
644views
What is the difference between these two MVC diagrams?
I want to understand what is the main difference in these two diagrams when it comes to the Model-View-Controller pattern. If there is a difference, how should I choose to construct my program? What ...
-1votes
1answer
107views
How can I prevent an object from being re-sanitized everytime it is passed as input to a function?
Suppose that I have a class named CharStream Additionally, there are a large number of functions which convert their function input into a CharStream def funky_the_function(_input): input = ...